<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<base href="<%=basePath%>">
<!-- jsp文件头和头部 -->
<%@ include file="../../system/admin/top.jsp"%>
</head>
<body>

	<div class="container-fluid" id="main-container">


		<div id="page-content" class="clearfix">

			<div class="row-fluid">

				<div class="row-fluid">

					<!-- 检索  -->
					<form action="actprocess/deploysave.do" method="post" enctype="multipart/form-data" name="Form" id="Form">
						<table>
							<tr>
								<td style="vertical-align: top;"></td>
								<td style="vertical-align: top;"></td>
							</tr>
						</table>
						<!-- 检索  -->

						<table id="table_report" class="table table-striped table-bordered table-hover">
								<tr>
									<td>流程分类:</td>
									<td><select
										class="chzn-select" name="category" id="category"
										data-placeholder="请选择" style="vertical-align: top; width: 120px;">
											<option value="1">审核流程</option>
											<option value="2">采购流程</option>
											<option value="3">报销流程</option>
											<option value="4">请假流程</option>
									</select>
									</td>
								</tr>
								<tr>
									<td>流程文件:</td>
									<td><input type="file" id="file" name="file" class="required"/>
										<span class="help-inline">支持文件格式：zip、bar、bpmn、bpmn20.xml</span>
									</td>
								</tr>
								<tr>
									<td colspan="2">
									<a title="提交" class="btn btn-small btn-info" onclick="submit()">提 交</a>&nbsp;&nbsp;
									<a title="返回" class="btn btn-small btn-warning" onclick="makeAll();"> 返 回 </a>
									</td>
								</tr>
						</table>
					</form>
				</div>
				
				<!-- PAGE CONTENT ENDS HERE -->
			</div>
			<!--/row-->
			
		</div>
		<!--/#page-content-->
	</div>
	<!--/.fluid-container#main-container-->

	<!-- 返回顶部  -->
	<a href="#" id="btn-scroll-up" class="btn btn-small btn-inverse"> <i
		class="icon-double-angle-up icon-only"></i>
	</a>

	<!-- 引入 -->
	<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
	<script src="static/js/bootstrap.min.js"></script>
	<script src="static/js/ace-elements.min.js"></script>
	<script src="static/js/ace.min.js"></script>

	<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script>
	<!-- 下拉框 -->
	<script type="text/javascript"
		src="static/js/bootstrap-datepicker.min.js"></script>
	<!-- 日期框 -->
	<script type="text/javascript" src="static/js/bootbox.min.js"></script>
	<!-- 确认窗口 -->
	<!-- 引入 -->
	<script type="text/javascript" src="static/js/jquery.tips.js"></script>
	<script type="text/javascript" src="static/js/jquery.form.js"></script>
	<!--提示框-->
	<script type="text/javascript">
		
		$(top.hangge());
		
		//检索
		function search(){
			top.jzts();
			$("#Form").submit();
		}
		
		//提交
		function submit(){
			var category = $("#category").val();
			var file = $("#file").val();
			if(category == ""){
				alert("请选择流程类别");
				return;
			}
			if(file == ""){
				alert("请选择要部署的流程文件");
				return;
			}
			$("#Form").ajaxSubmit({  
	            type: "POST",
	            dataType: "json",
	            url: $("#Form").attr("action"),
	            data: $("#Form").serialize(),
	            success: function (data) {
	               alert("部署成功,流程ID="+data.message);
	               location.reload();
	            },  
	            error: function (data) {
	            	alert("部署失败，"+data.message);
	            },//请求失败的函数  
	            async: true  
	    	});
		}
		
		$(function() {
			
			//下拉框
			$(".chzn-select").chosen(); 
			$(".chzn-select-deselect").chosen({allow_single_deselect:true}); 
			
			//日期框
			$('.date-picker').datepicker();
			
			//复选框
			$('table th input:checkbox').on('click' , function(){
				var that = this;
				$(this).closest('table').find('tr > td:first-child input:checkbox')
				.each(function(){
					this.checked = that.checked;
					$(this).closest('tr').toggleClass('selected');
				});
			});
		});
	</script>
</body>
</html>